<?php
/**
 * Template Name: Logged In
 * The template file for displaying the page content only for logged in users.
 * @package BrightNews
 * @since BrightNews 1.1.2
*/
get_header(); ?>
  
  <div id="main-content">
    <article id="content">
<?php if ( is_user_logged_in() ) { ?> 
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php brightnews_get_breadcrumb(); ?>
      <h1 class="main-headline"><?php the_title(); ?></h1>
<?php brightnews_get_display_image_page(); ?>
      <div class="entry-content">
<?php the_content( 'Continue reading' ); ?>
      </div>
<?php endwhile; endif; ?>
<?php comments_template( '', true ); ?> 
<?php } else { ?>
<h1 class="main-headline"><?php the_title(); ?></h1>
<p class="logged-in-message"><?php _e( 'You must be logged in to view this page.', 'brightnews' ); ?></p>
<?php wp_login_form(); } ?>
    </article> <!-- end of content -->
    
<?php get_sidebar(); ?>
  </div> <!-- end of main-content -->
<?php get_footer(); ?>